
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/17 10:18
 */

#include "iostream"

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int total = 0;
    int idx = 0;
    int maxfall = 1;

    for (int i = 0; i < n; ++i) {
        int init;
        scanf("%d", &init);
        int fall = 0;
        for (int j = 0; j < m; ++j) {
            int tmp;
            scanf("%d", &tmp);
            fall += tmp;
        }
        total += init + fall;
        if (maxfall > fall) {
            idx = i + 1;
            maxfall = fall;
        }
    }

    cout << total << " " << idx << " " << abs(maxfall);

    return 0;
}